<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加用户</title>
<jsp:include page="../../../common/head.jsp">
	 <jsp:param name="_useTab" value="true"/>
	 <jsp:param name="_useTree" value="true"/>
</jsp:include>
<script language="javascript">
	function saveUser(){
		xj.showNotice=true;
		var objarr = new Array(
		["userlist.userId","用户标识","notEmpty",""],
		["userlist.userName","用户姓名","notEmpty",""],
		["userlist.password","用户密码","notEmpty",""],
		["userlist.password","用户密码","min","String:6"],
		["userlist.userOrder","用户排序","notEmpty",""],
		["userlist.groupSign","分组标识","notEmpty",""],
		["repassword","密码确认","notEmpty",""],
		["userlist.password","两次输入密码不一致！","eqO","repassword"],
		["userlist.userOrder","用户排序","int","2"],
		["userlist.userId","用户标识","max","String:20"],
		["userlist.password","用户密码","max","String:50"],
		["userlist.email","email","max","String:100"],
		["userlist.groupSign","分组标识","max","String:20"],
		["userlist.officeTel","办公电话","max","String:20"],
		["userlist.mobileTelephone","办公电话","max","String:15"],
		["userlist.remark","备注","max","String:500"]
		);
		if(xj.CheckAll(objarr))
		{
			checkUser();
		}
	}
	function checkUser()
	{
		var tmp = parseInt(Math.random()*10000+1);//设定随机数防止浏览器以相同url重复多次访问不进行请求
		var url = 'checkExistsUser.do?userlist.userId='+document.getElementById("userlist.userId").value+"&tmp="+tmp;
		$.get(url, {},function (data, textStatus){
			if(data=="ok")
			{
				if(confirm("确认保存？"))
				{
					//处理用户权限部分信息
					if($("#updFunc").length>0)
					{
						//调用修改权限页的js全部选中右侧所选权限组
						selectFuncRightAll();
					}
					document.form1.submit();
				}
			}
			else
			{
				alert("用户ID已存在，请重新设置！");
			}
		});
	}
	//返回
	function goback()
	{
		window.location.href="listUser.do";
	}
	$(document).ready(function()
	{
		xjTabs.initTab();
	});	
</script>

</head>
<body >
<form name="form1"  action="saveUser.do" method="post">
	<div id="body_div">
	<w:ShowTitle name="添加用户">
	<w:TitleButton funcName="保存" onClickFunction="saveUser()" urlImg="${ctx}/images/main/save.png" />
	<w:TitleButton funcName="返回" onClickFunction="goback()" urlImg="${ctx}/images/main/back.png"/>
	</w:ShowTitle>
	<div id="body_content">
	<div class="Sliding_tab">
		<ul>
			<li></li><li><span class="tabsLink" id="setTab0" link="#">基本信息</span></li><li></li>
			<li></li><li><span class="tabsLink" id="setTab1" link="listFuncUser.do?type=${param.type}">菜单权限</span></li><li></li>
			<li></li><li><span class="tabsLink" id="setTab2" link="listRoleUser.do?type=${param.type}">基础数据授权分配</span></li><li></li>
			<li></li><li><span class="tabsLink" id="setTab3" link="listReportUser.do?type=${param.type}">报表权限</span></li><li></li>
		</ul>
	</div>
	<table width="100%" id="content0" class="tabContent">
		<tr>
		<td>登录ID</td>
		<td class="left_align">
		<input name="userlist.state" type="hidden" value="A"/>
		<input name="type" type="hidden" value="${param.type}"/>
		<input name="userlist.userId" id="userlist.userId" type="text" maxlength="20"/></td>
		<td>用户姓名</td>
		<td class="left_align"><input name="userlist.userName" type="text" maxlength="25"/></td>
	</tr>
	<tr>
		<td>用户密码</td>
		<td class="left_align"><input name="userlist.password" type="password" maxlength="25"/></td>
		<td>重复输入密码</td>
		<td class="left_align"><input name="repassword" type="password" maxlength="25"/></td>
	</tr>
	<tr>
		<td>办公室电话</td>
		<td class="left_align"><input name="userlist.officeTel" type="text" maxlength="20"/></td>
		<td>移动电话</td>
		<td class="left_align"><input name="userlist.mobileTelephone" type="text" maxlength="15"/></td>
	</tr>
	<tr>
		<td>email</td>
		<td class="left_align"><input name="userlist.email" type="text" maxlength="100"/></td>
		<td>用户排序</td>
		<td class="left_align"><input name="userlist.userOrder" type="text" maxlength="2"/></td>
	</tr>
	<tr>
		<td>分组标识</td>
		<td class="left_align"><input name="userlist.groupSign" type="text" maxlength="25"/></td>
		<td>登录IP</td>
		<td class="left_align"><input name="userlist.loginIpAddress" type="text" maxlength="25"/></td>
	</tr>
	<tr>
		<td>框架样式</td>
		<td class="left_align" colspan="3">
			菜单图标样式
			<input name="icoStyle" type="radio" class="radio" value="ico_big" checked="checked"/>大
			<input name="icoStyle" type="radio" class="radio" value="ico_small"/>小
			<br/>
			分标签显示页面
			<input name="tabStyle" type="radio" class="radio" value="tabFrame_yes"/>是
			<input name="tabStyle" type="radio" class="radio" value="tabFrame_no" checked="checked"/>否
		</td>
	</tr>
	<tr>
		<td>备注</td>
		<td class="left_align" colspan="3">
			<textarea rows="5" cols="80" name="userlist.remark"></textarea>
		</td>
	</tr>
	</table>
	</div>
	</div>	
</form>
</body>
</html> 